package com.test06_字符串;

import org.junit.Test;

/**
 * String字符串
 */
public class YootkDemo_01 {

    @Test
    public void test1() {
        {
            String message = "沐言优拓：www.yootk.com";
            System.out.println(message);
        }
        {
            String message = new String("沐言优拓：www.yootk.com");
            System.out.println(message);
        }
    }

    @Test
    public void test2() {
        {
            String strA = "yootk";
            String strB = new String("yootk");
            String strC = strB;
            System.out.println(strA == strB);
            System.out.println(strA == strC);
            System.out.println(strB == strC);
        }
        {
            String strA = "yootk";
            String strB = new String("yootk");
            String strC = strB;
            System.out.println(strA.equals(strB));
            System.out.println(strA.equals(strC));
            System.out.println(strB.equals(strC));
        }
    }

    /**
     * 使用文本块定义字符串
     * JDK13引入
     */
    @Test
    public void test3() {
        /*String message = """
            沐言优拓：www.yootk.com
            李兴华编程训练营：edu.yootk.com
        """;
        System.out.println(message);*/
    }
}
